﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace AltimilliaLibrary
{
    public class MainCharacter : Sprite
    {
        public delegate void TileChanged(Point oldPosition, Point newPosition);
        public event TileChanged MCChangedTime;
        private Point OldPosition;

        public MainCharacter(Point TilePosition, Sprite.Facing Facing, float maxSpeed, AnimationData animdata)
            : base(TilePosition, Facing, maxSpeed, animdata)
        {
        }

        public override void Update(GameTime gameTime)
        {
            if (OldPosition != this.TilePosition)
            {
                if (MCChangedTime != null)
                {
                    MCChangedTime(OldPosition, this.TilePosition);
                }
            }
            OldPosition = this.TilePosition;
            base.Update(gameTime);
        }
    }
}
